package com.dameng.jianyouquan.base;

import android.annotation.SuppressLint;
import android.app.Application;
import android.content.Context;
import android.os.Handler;

import androidx.multidex.MultiDex;

import com.dameng.jianyouquan.api.NetWorkManager;
import com.mob.MobSDK;

import cn.jpush.android.api.JPushInterface;


public class App extends Application {

    private static int mMainThreadId;
    private static Handler mhandler;
    @SuppressLint("StaticFieldLeak")
    private static Context context;


    public static Context getContext() {
        return context;
    }


    @Override
    public void onCreate() {
        super.onCreate();
        context = this;

        // 初始化. 建议在 Application 中进行初始化.
//        String appKey = "融云开发者后台创建的应用的 AppKey";
//        RongIM.init(getApplicationContext(), appKey);

        NetWorkManager.getInstance().init(this);
        JPushInterface.setDebugMode(true);
        JPushInterface.init(this);
        mhandler = new Handler();
        MobSDK.submitPolicyGrantResult(true, null);


    }


    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }

    public static int getMainThreadId() {
        return mMainThreadId;
    }

    public static Handler getHandler() {
        return mhandler;
    }
}
